package io.mft.commons.db;

import io.mft.commons.function.response.kv.KVMap;

public class SQLIdParameter implements ISQLParameter {
	private String sqlId;
	private String datasourceId;
	private Class<?> mapperClass;
	@Override
	public String sqlId() {
		return sqlId;
	}

	@Override
	public void sqlId(String sqlId) {
		this.sqlId=sqlId;
		
	}
	

	@Override
	public SQL sqlText(KVMap parameter) {
		SQL sql=DbUtil.loadSQL(mapperClass, sqlId, parameter);
		return sql;
	}

	@Override
	public void mapper(Class<?> mapperClass) {
		this.mapperClass = mapperClass;
	}

	@Override
	public Class<?> mapper() {
		return mapperClass;
	}

	@Override
	public void datasourceId(String datasourceId) {
		this.datasourceId=datasourceId;
	}

	@Override
	public String datasourceId() {
		return datasourceId;
	}
}
